<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <title>PyScript Bridge</title>
        <script type="importmap">
          {
            "imports": {
              "https://esm.run/@pyscript/bridge": "https://esm.run/@pyscript/bridge@latest",
              "https://esm.run/@pyscript/bridge/test/test.js": "https://esm.run/@pyscript/bridge@latest/test/test.js"
            }
          }
        </script>
        <style>body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; }</style>
        <link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css" />
        <script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
        <script type="module">
          const cdn_test = 'https://esm.run/@pyscript/bridge/test/test.js';
          const { ffi: { test_func, test_other, version } } = await import(cdn_test);

          console.time("⏱️ first invoke");
          const result = await test_func("PyScript Bridge");
          console.timeEnd("⏱️ first invoke");

          document.body.append(
            Object.assign(
              document.createElement("h3"),
              { textContent: result },
            ),
            document.createElement("hr"),
            await version(),
          );

          console.time("⏱️ other invokes");
          await test_other("🐍");
          console.timeEnd("⏱️ other invokes");
        </script>
    </head>
</html>
